<!DOCTYPE HTML>
<html>
	<head>
		<title>点击右键返回自定义菜单</title>
		<meta charset="utf-8">
		<style>
			#div1{
				width:200px;
				height:200px;
				background: #ccc;
				position: absolute;
				display: none;

			}
		</style>
		<script>
		window.onload=function(){
			var oDiv=document.getElementById('div1');

			document.oncontextmenu=function(ev){
				var oEvent=ev||event;
				oDiv.style.left=oEvent.clientX+'px';
				oDiv.style.top=oEvent.clientY+'px';
				oDiv.style.display="block";
				return false;
			}
			document.onclick=function(){
				oDiv.style.display="none";
			}
		}
		</script>
	</head>
	<body>
		<div id="div1">
			<ul>
				<li>哈哈</li>
				<li>嘿嘿</li>
				<li>游戏</li>
				<li>哟西</li>
			</ul>
		</div>
	</body>
</html>